﻿namespace Microsoft.AspNetCore.Mvc.Infrastructure;

public class BpctFileStreamResultExecutor : FileStreamResultExecutor, IActionResultExecutor<BpctFileStreamResult>
{
    public BpctFileStreamResultExecutor(ILoggerFactory loggerFactory) : base(loggerFactory)
    {

    }

    public virtual Task ExecuteAsync(ActionContext context, BpctFileStreamResult result)
    {
        if (context is null)
        {
            throw new ArgumentNullException(nameof(context));
        }

        if (result is null)
        {
            throw new ArgumentNullException(nameof(result));
        }

        context.SetContentDispositionHeader(result);

        return base.ExecuteAsync(context, result);
    }
}